<!DOCTYPE html>
<html>
<head>
	<title>上传</title>
</head>
<body>
	<input type="file" name="" id='fileId'>
	<button onclick='sendFile()'>上传</button>
<script>
const xmlhttp = new XMLHttpRequest();
const sendFile = () => {
	console.log(111);
	const formData = new FormData();
	const file = document.getElementById("fileId").files[0];
	xmlhttp.open('post', '/upload.do', true);
	xmlhttp.setRequestHeader('X-Requeted-with', 'XMLHttpRequest');
	formData.append('file', file);
	xmlhttp.send();
};
</script>
</body>
</html>